home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 February / PCWorld_2007-02_cd.bin / domacnost a kancelar / avedesk / AveDesk13.exe / Effects / Bounce.effectlet < prev    next >
Extensible Markup Language  |  2004-11-07  |  3KB  |  147 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <effectlet>
  3.     <info>
  4.         <name>Bounce Effect Script</name>
  5.         <author>Fabien LAMAISON @ KERIN</author>
  6.         <notes><![CDATA[
  7. I'm just trying to do
  8. some things here
  9.         ]]></notes>
  10.         <version>0.0.7</version>
  11.     </info>
  12.     <settings>
  13.         <param name="Debug" type="Boolean" defval="False"/>
  14.     </settings>
  15.     <preferences>
  16.         <preference name="MouseOver" type="Boolean" defval="True" >
  17.         Toggles mouseover effect.
  18.         </preference>
  19.     </preferences>
  20.     <images>
  21.     </images>
  22.     <script engine="vbScript"><![CDATA[
  23.  
  24.     Dim Counter
  25.     Dim StartTop, StartLeft
  26.     Dim TickRate
  27.  
  28.     Dim isOver
  29.     Dim isMounting
  30.  
  31.     'These routines are the optional ones called by the framework
  32.     Sub OnCreate()
  33.         MouseOver.value = true
  34.         isOver = false
  35.         isMounting = true
  36.         TickRate = 150
  37.         Counter = 0
  38.  
  39.         StartTop = Desklet.top
  40.         StartLeft = Desklet.left
  41.  
  42.         'And Reading overwrites them with some previous user changes
  43.         Preferences.ReadAll()
  44.     End Sub
  45.  
  46.     Sub OnMouseOn()
  47.         StartTop = Desklet.top
  48.         StartLeft = Desklet.left
  49.         isMounting = true
  50.         Counter = 0
  51.         Ticker.Interval = TickRate
  52.         Ticker.Enabled = True
  53.         isOver = true
  54.     End Sub
  55.  
  56.     Sub OnMouseout()  
  57.         isOver = false
  58.         Ticker.Enabled = False
  59.         Desklet.Move StartLeft, StartTop
  60.         'Desklet.Redraw()
  61.     End Sub
  62.  
  63.     'Function OnBeforeDraw(IsMouseOn, IsSelected, IsPreview)
  64.     'End Function
  65.  
  66.     'Function OnAfterDraw(IsMouseOn, IsSelected, IsPreview)
  67.     'End Function
  68.     
  69.     Sub OnSave()
  70.         Preferences.SaveAll 
  71.     End Sub
  72.  
  73.     'Optional. Indicates a preference change
  74.     Function OnPreferenceChange(Preference, oldValue, newValue)
  75.     End Function
  76.  
  77.  
  78.     'You can only have 1 Ticker per effectlet
  79.     'The OnTimer method is shielded against multiple entrance recursion
  80.     Sub OnTimer()
  81.         if isMounting then
  82.             if Counter < 20 then
  83.                 Counter = Counter + 4
  84.             Else
  85.                 Counter = Counter - 4
  86.                 isMounting = false
  87.             End If
  88.         Else
  89.             if Counter > 0 then
  90.                 Counter = Counter -4
  91.             Else
  92.                 Counter = Counter + 4
  93.                 isMounting = true
  94.             End If
  95.         End If
  96.         
  97.         Desklet.Move Desklet.Left,StartTop + Counter
  98.         'Desklet.Redraw()
  99.     End Sub
  100.  
  101.     'Optional calls that we don't need for this script:
  102.  
  103.     'Sub OnSelect()   
  104.     'End Sub
  105.  
  106.     'Sub OnDeselect()   
  107.     'End Sub
  108.  
  109.     'Sub OnShow()         
  110.     'End Sub
  111.  
  112.     'Sub OnHide()         
  113.     'End Sub
  114.  
  115.     'Sub OnConfigure() 
  116.         'the configuration dialog with default UI for
  117.         'XML preferences will be shown.
  118.         'An additional dialog designer is on its way. It will
  119.         'extend the available default preferences of type:
  120.         ' - slider, checkbox, combobox (builtin, v. 1.1, free on form with v. 1.2)
  121.         ' - textbox, file browser, favorites URL (builtin and free on form, v. 1.2)
  122.         ' - Any ocx (external, only free on form, v. 1.2)
  123.     'End Sub
  124.  
  125.     Sub OnStartMove() 
  126.             isOver = false
  127.         Ticker.Enabled = False
  128.         Desklet.Move StartLeft, StartTop
  129.     End Sub
  130.  
  131.     Sub OnEndMove()
  132.     OnMouseOn
  133.     End Sub
  134.  
  135.     'Sub OnLeftClick()  
  136.     'End Sub
  137.  
  138.     'Sub OnRightClick()
  139.     'End Sub
  140.  
  141.     'Sub OnDestroy
  142.     'End Sub
  143.  
  144.  
  145.     ]]></script>
  146. </effectlet>
  147.